﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class stuks : System.Web.UI.Page
{
    public string mune = "";
    public string indexcontent = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] == null || Session["usertype"] == null)
            {
                JScript.AlertAndRedirect("进行信息检测，请重新登录！", "leks.aspx");
                return;
            }
        }
        if (Request.QueryString["Classid"] != null)
        {
            int mClassid = int.Parse(Request.QueryString["Classid"]);
            if (mClassid.Equals(1))
            {
                CleanWebSession();
                mune = "新闻公告";
            }
            else if (mClassid.Equals(2))
            {
                mune = "在线练习";
            }
            else if (mClassid.Equals(3))
            {
                mune = "进入考试";
            }
            else if (mClassid.Equals(4))
            {
                CleanWebSession();
                mune = "考试成绩查询";
            }
            else if (mClassid.Equals(5))
            {
                CleanWebSession();
                mune = "练习成绩查询";
            }
            else
            {
                CleanWebSession();
                mune = "学生考试";
            }
        }
        else
        {
            mune = "学生考试";
        }
    }
    public void CleanWebSession()
    {
        CookieOper.CleanSession("ProSeList");
        CookieOper.CleanSession("SeIndex");
        CookieOper.CleanSession("selMark");
        CookieOper.CleanSession("PanDMark");
        CookieOper.CleanSession("IsEqual");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        CookieOper.CleanSession("ProSeList");
        CookieOper.CleanSession("SeIndex");
        Response.Redirect("stuks.aspx?Classid=2");
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    { 
        CookieOper.CleanSession("username");
        CookieOper.CleanSession("usertype");
        CookieOper.CleanSession("stuproType");
        CookieOper.CleanSession("ProSeList");
        CookieOper.CleanSession("SeIndex");
        CookieOper.CleanSession("selMark");
        CookieOper.CleanSession("PanDMark");
        CookieOper.CleanSession("IsEqual");
        JScript.AlertAndRedirect("正在退出考试！", "leks.aspx");
    }
}
